home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Games / Game Sample Code / ZAM 1.0a13 / GameHeaders / GameSounds.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-16  |  1.1 KB  |  60 lines  |  [TEXT/KAHL]

  1. #pragma once
  2. #include <Sound.h>
  3.  
  4. #define kNumChan 4
  5. enum {
  6.     kWakeUpSnd    = 128,
  7.     kFireSnd    = 129,
  8.     kRiffSnd    = 130,
  9.     kBadFireSnd    = 131,
  10.     kExplode    = 132,
  11.     kYouLose   = 133,
  12.     kYouWin     = 134,
  13.     kIncidental1 = 135,
  14.     kEngineStart = 136,
  15.     kIncidental2 = 137,
  16.     kEngineLoop  = 138,
  17.     kIncidental3 = 139,
  18.     kIncidental4 = 140,
  19.     kIncidental5 = 141
  20. };
  21.  
  22. enum {
  23.     kStdPriority = 0x01,
  24.     kMedPriority = 0x05,
  25.     kHighPriority = 0x0A
  26. };
  27.  
  28. enum {
  29.     kMusicChan,
  30.     kShotChan,
  31.     kExplosionChan,
  32.     kFlightChan
  33. };
  34.  
  35. typedef struct {
  36.     SndChannelPtr    channel;
  37.     short            priority;
  38.     Handle            sndHandle;
  39. } SndChanInfo;
  40.  
  41.  
  42. /* call this when your program starts */
  43. void InitSounds(Str255    sndFileName);
  44.  
  45. /* call this from your main loop */
  46. void SoundKeeper();
  47.  
  48. /* use this to play sounds */
  49. OSErr PlaySndAsynchChannel(short sndID, short chanNum, short priority);
  50.  
  51. /* call this when your program quits */
  52. void FreeSounds(void);
  53.  
  54. /* misc routines used internally */
  55. pascal void SndDoneProc(SndChannelPtr channel, SndCommand *cmd);
  56. Handle    GetSound(short    sndID);
  57.  
  58. /* private global variables */
  59. extern SndChanInfo    gChan[kNumChan];
  60.